package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.DebugActivity;
import flc.ast.activity.PortScanActivity;
import flc.ast.activity.UdpCombActivity;
import flc.ast.databinding.FragmentAdjustBinding;
import stark.common.basic.base.BaseNoModelFragment;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link AdjustFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class AdjustFragment extends BaseNoModelFragment<FragmentAdjustBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_adjust;
    }

    @Override
    protected void initView() {
        mDataBinding.ivTcpServer.setOnClickListener(this);
        mDataBinding.ivTcpClient.setOnClickListener(this);
        mDataBinding.ivUdpServer.setOnClickListener(this);
        mDataBinding.ivUdpClient.setOnClickListener(this);
        mDataBinding.ivUdpComb.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.ivTcpServer://tcp服务端
                DebugActivity.type = 0;
                startActivity(DebugActivity.class);
                break;
            case R.id.ivTcpClient://tcp客户端
                DebugActivity.type = 1;
                startActivity(DebugActivity.class);
                break;
            case R.id.ivUdpServer://udp服务端
                DebugActivity.type = 2;
                startActivity(DebugActivity.class);
                break;
            case R.id.ivUdpClient://udp客户端
                DebugActivity.type = 3;
                startActivity(DebugActivity.class);
                break;
            case R.id.ivUdpComb://udp组播端
                startActivity(UdpCombActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}